const routes = [
    //一级路由
    {
      path: '/index',
      name: 'index',
      component: () => import('../components/Index'),
      children:[ //二级路由
        {
          path: '/index/shouye',
          name: 'shouye',
          component: () => import('../components/Index/shouye'),
        },
        {
          path: '/index/tuan',
          name: 'tuan',
          component: () => import('../components/Index/baobao'),
        
        },
        {
          path: '/index/order',
          name: 'order',
          component: () => import('../components/Index/dingdan'),
        },
        {
          path: '/index/mine',
          name: 'mine',
          component: () => import('../components/Index/mine'),
        },
        // {
        //   path: '/index',
        //   redirect:'/index/shouye' //重定向
        // },
        // 404 路由
        {
          path:'*', // * 表示匹配任何路由(所有路由)
          component: () => import('../components/NotFound.vue')
        }

      ]
    },
    {
      path: '/gouwu',
      name: {title:'购物车'},
      component: () => import('../components/Index/GouWu')
    },
    {
      path: '/dizhi',
      name: {title:'我的地址'},
      component: () => import('../components/Index/dizhi')
    },
    {
      path: '/dizhibj/:id',
      name: {title:'编辑地址22'},
      component: () => import('../components/Index/bianjidizhi')
    },
    {
      path: '/editdizhi',
      name: {title:'编辑地址'},
      component: () => import('../components/Index/addressList')
    },
    {
      path: '/xiangqing/:id',
      name: {title:'详情页面'},
      component: () => import('../components/Index/xiangqing')
    },
    {
      path: '/shoucang',
      name: {title:'收藏页面'},
      component: () => import('../components/Index/shoucang')
    },
 
    {
      path:'/',
      redirect:'/zhuce' //重定向
    },
    {
      path: '/zhuce',
        name: {title:'详情页面'},
      component: () => import('../components/zhuce.vue')
    },
    {
      path: '/denglu',
      name: {title:'登陆页面'},
      component: () => import('../components/denglu.vue')
    },
    {
      path: '/Phone',
      name: {title:'手机登录'},
      component: () => import('../components/Pnhone.vue')
    },
    // 404 路由
    {
      path:'*', // * 表示匹配任何路由(所有路由)
      component: () => import('../components/NotFound.vue')
    }
]

export default routes;